// 引入axios
import axios from "axios"

export default class Http{
    constructor(){
        // 配置axios
        axios.defaults.baseURL= "http://106.13.22.176:9090/api/v1"
        axios.interceptors.response.use(
            (response)=>{
                return response.data ||response;
            },
            (error)=>{
                return Promise.reject(error)
            }
        )
        this.$axios = axios

    }
    get(url){
        return axios.get(url)
    }
    post(url,data){
        return axios.post(url,data)
    }
}